package data.reader;

import java.util.ArrayList;

import util.file.FileParser;
import util.file.IFileParser;



public abstract class GenericFileReader<T> extends FileParser implements IFileParser
{
	protected ArrayList<T> list = new ArrayList<T>();
	
	public GenericFileReader(String filePath)
	{
		super(filePath, null);
		cb = this;
	}
	
	public abstract ArrayList<T> get();
	
	protected abstract T newInstance(String row);
	
	@Override
	public void OnParseFileRow(String row)
	{
		T obj = newInstance(row);
		if (obj != null)
			list.add(obj);
	}
}
